﻿@model HMoPro.Models.checkvr

@{
    ViewBag.Title = "checkVr";
}
@Styles.Render("~/Content/main.css")
<script>

    //变量名中多了空格，倒置调试了半天
    $(function () {

        $("#dianzan").attr('disabled', false);

        $('a#@Model.resourceid').bind("click", function () {
            $.ajax({
                url:"@Url.Action("bofangshu")",
                data: { "resourceid": '@Model.resourceid'},
               dataType: "json",
               type: "POST",
               success: function (data) {
                 //  $("#dianzan").attr('disabled', true);
                    }
                });


            })


        $('button#dianzan').bind("click", function () {
                $.ajax({
                    url:"@Url.Action("dianzan")",
                    data: { "resourceid": '@Model.resourceid'},
                    dataType: "json",
                    type: "POST",
                    success: function (data) {
                            $("#dianzan").attr('disabled',true);
                    }
                });


        })


        $('button#telephone').bind("click", function () {
            var aa = window.location.href;
            $.ajax({
                url: "@Url.Action("QRcode")",
                data: { "resourceid": '@Model.resourceid', "url": aa },
                dataType: "json",
                type: "POST",
                success: function (data) {
                    //    $("#dianzan").attr('disabled', true);
                    window.open("@Url.Action("QRcodeImage")"+"?resourceid="+'@Model.resourceid');

                        @*   window.location.href ="@Url.Action("QRcodeImage")"+"?resourceid="+'@Model.resourceid';*@
                    }
            });


                })









        }  )

</script>

<style>
    #checkVR {
        display:inline-block;
        position: absolute;
        top:15px;
        right:15px;
    }
</style>
@if  ( !(User.IsInRole("Admin") || User.IsInRole("NomalUser"))) { 
 <div class="ml"><span>分类目录 > </span>
    @foreach (var item in ViewData["categoryname"] as IEnumerable<DataModel.Category>)
    {<span>@item.Name</span>}
</div>   
}

<div style="padding-top:20px;">
    <div class="row" style="position: relative; margin: 20px 4%; padding-bottom: 15px; background-color: #FFF; box-shadow: 0 3px 3px #989898">
       <div class="col-xs-12">
            <h2 class="pull-left">@Model.Title<small>@Model.subtitle</small></h2>
        </div>
        @if (User.Identity.IsAuthenticated)
        {
            <span id="checkVR">@Html.ActionLink("编辑", "EditResourceFirstPart", new { resourceid = @Model.resourceid })</span>
        }
        <div class="col-xs-12 col-sm-10">
            <p>
                <span class="width-bf db">播放数 @Model.PlayTime</span>
                <span class="width-bf dz">点赞数 @Model.PraiseTime</span>
            </p>
        </div>
        <div class="col-xs-12 col-sm-2 text-right">
            @if (!User.Identity.IsAuthenticated)
            {
                <div class="bdsharebuttonbox">
                    <a href="#" class="bds_more" data-cmd="more"></a>
                    <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
                    <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
                    <a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a>
                </div>
                <script>window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "1", "bdMiniList": ["tsina", "renren", "sqq", "copy"], "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
            }
        </div>

        <div class="col-xs-12" style="padding:5px 0;">
            <a href="../../Uploads/@Model.resourceid/@ViewData["resourcezipid"]/@ViewData["inboxname"]/index.html"  id="@Model.resourceid"  class="mainURL" target="_blank"> <img src="../../Uploads/@Model.resourceid/@Model.imageurl" class="img-responsive" style="width:100%;"> </a>

            @*        <a href="../../Uploads/@Model.resourceid/@Model.resourceid/@ViewData["boxname"]/index.html" target="_blank" id="@Model.resourceid"> <img src="../../Uploads/@Model.resourceid/@Model.imageurl" class="img-responsive" style="width:100%;"> </a>*@
            @*@Model.resourceid@Model.resourceid@Model.resourceid*@
        </div>
        <div class="col-xs-12 col-sm-offset-5 col-sm-2 text-center" style="padding-top:10px;">
            @if (!User.Identity.IsAuthenticated)
            {
                <button type="button" id="dianzan" class="button button-raised button-caution button-pill button-large"><span>点赞</span></button>
                @*<button type="button" id="telephone" class="button button-primary">手机看</button>*@
            }
        </div>
        <div class="col-xs-12 col-sm-5 text-right">
            @{Html.RenderAction("browseList", new { resourceid = Model.resourceid });}
        </div>
        <div class="col-xs-12">
            @*<h4>@Html.DisplayNameFor(model => model.Location)</h4>
            <p>@Html.DisplayFor(model => model.Location)</p>
            <h4>@Html.DisplayNameFor(model => model.Descrb)</h4>*@
            <p class="descrb">@Html.DisplayFor(model => model.Descrb)</p>
        </div>
    </div>
    <div class="row" style="padding-top:10px; position: relative; margin: 0 3%;">
        <div class="col-xs-12 text-center">
            @if (User.IsInRole("Admin"))
            {
                <span>
                    @Html.ActionLink("通过", "VrPass", new { rescourceid = Model.resourceid, passid = 1 }, new { @class = "button button-raised button-caution button-pill" })  &emsp;
                    @Html.ActionLink("不通过", "VrPass", new { rescourceid = Model.resourceid, passid = 2 }, new { @class = "button button-danger" })
                </span>
            }
        </div>
        @if (!User.Identity.IsAuthenticated)
        {
            Html.RenderAction("Recommend", new { rescourceid = @Model.resourceid });
        }
    </div>
    
    </div>

<script>
    $("#carousel-hm").css("display", "none");
    $(document).ready(function () {
        $(".mainURL").attr("href", $(".test").attr("href"));
    });
</script>

<script>
    $("#carousel-hm").css("display", "none");
    $("#f1 a").html("<font> " + $("#f1 a").text() + " </font>")
    $("#f1 a").addClass("selected");
</script>